package com.power.using.askapp.utils;

import android.app.ProgressDialog;
import android.content.Context;

import com.power.using.askapp.R;


/**
 * If you change her, tell me
 * sometimes I believe compiler ignores all my comments
 * Created by gyyak46 on 2017/5/25.
 */

public class DialogUtil {


    /**
     * 带进度条的Dialog
     */
    private static ProgressDialog progressDialog;

    public static void showProgressDialog(Context context, CharSequence message) {
        if (progressDialog == null) {
            progressDialog = new ProgressDialog(context);
            progressDialog.setProgressStyle(R.style.BMProgressDialog);
            progressDialog.setIndeterminate(true);
        }
        progressDialog.setCanceledOnTouchOutside(false);
        progressDialog.setMessage(message);
        progressDialog.show();
    }

    public static void dismissProgressDialog() {
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
    }

}
